package com.itheima.controller;

import com.itheima.service.DataSyncService;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/datasync")
@CrossOrigin
public class DataSyncController {

    @Autowired
    private DataSyncService dataSyncService;

    @GetMapping("/importAll")
    public Result importAll(){
        dataSyncService.importAll();
        return new Result(true,null,"操作成功",null);
    }
}